//package com.example.demo.config.datasource;
//
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.mybatis.spring.SqlSessionFactoryBean;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import javax.sql.DataSource;
//
//@Configuration
//@MapperScan(basePackages = "com.example.demo.DAO.myBatisDao",sqlSessionFactoryRef="mysqlSessionFactory")
//public class MybatisConfig {
//
//    @Bean(name="mysqlSessionFactory")
//    @Autowired
//    @Qualifier("mysqlDB")
//    public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception{
//        final SqlSessionFactoryBean sessionFactory=new SqlSessionFactoryBean();
//        sessionFactory.setDataSource(dataSource);
//        return sessionFactory.getObject();
//    }
//}
